package DataBase;

import java.sql.*;

public class DAO {

    public ResultSet rs;
    public Connection con;
    public PreparedStatement pstmt;

    public void Conectar() {

       try{
        Class.forName("org.postgresql.Driver");
       // String url = "jdbc:postgresql://10.0.30.18:5432/postgres";
         String url = "jdbc:postgresql://localhost:5432/postgres";
        String user = "postgres";
        String senha = "postgres";
        con = DriverManager.getConnection(url, user, senha);
       
       }catch(SQLException sqlex){
       }catch(ClassNotFoundException ex){}


    }

    public void Desconectar() {
        try {
            if (con != null) {
                con.close();
                            }
        } catch (SQLException sqlex) {
        }
    }
}
